import React,{PureComponent} from 'react'
import {View,Image,StyleSheet,TouchableOpacity,Text,Dimensions,Button,Platform} from 'react-native'



type Props = {
    info:Object,
    onPress:Function,
}

export default class DetailTeacherCell extends PureComponent<Props>{

    render(){
        let short_introduce = this.props.info.short_introduce?this.props.info.short_introduce:'暂无内容'
        return (
            <TouchableOpacity style={styles.container} onPress={()=>{this.props.onPress()}}>
                <Image style={styles.image} source={{uri:this.props.info.image}}/>
                <View style={styles.teacher_view}>
                    <Text style={styles.name}>{this.props.info.name}</Text>
                    <Text style={styles.detail}>{short_introduce}</Text>
                </View>
            </TouchableOpacity>
        )
    }
}
const styles =StyleSheet.create({
    container:{
        flexDirection:'row',
        paddingRight:12,
        paddingLeft:12,
        paddingBottom:10,
        marginBottom:10,
        backgroundColor:'white',
    },
      image:{
        width:50,
          height:50,
          borderRadius:25,
      } ,
    teacher_view:{
      marginLeft:20,
      backgroundColor:'white',
        flex:1,
    },
    name:{
        color:'black',
        fontSize:14,
        fontWeight:'bold',
    },
    detail:{
        marginTop:15,
        fontSize:11,
        color:'black',
        fontWeight:'200',
        lineHeight:20,
    },
})